<template>
  <div class="indexContentContainer">
    <div class="menu">
      <div class="menuTopTitle">
        <img :src="menuTitleIcon" class="icon" />
        <span class="title">我的收藏</span>
      </div>
      <el-menu
        :default-active="defaultActive"
        @select="handleSelect"
        :collapse="false"
      >
        <el-menu-item
          v-for="item in menuList"
          :index="item.value"
          :key="item.value"
          >{{ item.title }}</el-menu-item
        >
      </el-menu>
    </div>
    <div class="content">
      <positionTable v-if="currentTab == '1'"></positionTable>
      <companyTable v-else-if="currentTab == '2'"></companyTable>
      <careerTable v-else-if="currentTab == '3'"></careerTable>
      <caseTable v-else-if="currentTab == '4'"></caseTable>
      <videoTable v-else-if="currentTab == '5'"></videoTable>
      <presentationTable v-else-if="currentTab == '6'"></presentationTable>
      <resumeTemplateTable
        v-else-if="currentTab == '7'"
      ></resumeTemplateTable>
    </div>
  </div>
</template>

<script>
import positionTable from './components/positionTable.vue';
import companyTable from './components/companyTable.vue';
import careerTable from './components/careerTable.vue';
import caseTable from './components/caseTable.vue';
import resumeTemplateTable from './components/resumeTemplateTable.vue';
import presentationTable from './components/presentationTable.vue';
import videoTable from './components/videoTable.vue';
import menuTitleIcon from '@/assets/detail/menuIcon/careerGrowthSelected.png';
export default {
  name: 'Collection',
  components: {
    positionTable,
    companyTable,
    presentationTable,
    caseTable,
    careerTable,
    videoTable,
    resumeTemplateTable
  },
  data() {
    return {
      menuTitleIcon,
      currentTab: '1',
      defaultActive: '1',
      menuList: [
        { title: '岗位', value: '1' },
        { title: '公司', value: '2' },
        { title: '职业', value: '3' },
        { title: '案例', value: '4' },
        { title: '视频', value: '5' },
        { title: '课件', value: '6' },
        { title: '简历模板', value: '7' }
      ],
      menuIconList: [
        require('../../../assets/detail/menuIcon/train@2x.png'),
        require('../../../assets/detail/menuIcon/trainSelected@2x.png'),
        require('../../../assets/detail/menuIcon/sal@2x.png'),
        require('../../../assets/detail/menuIcon/salSelected@2x.png'),
        require('../../../assets/detail/menuIcon/recruit@2x.png'),
        require('../../../assets/detail/menuIcon/recruitSelected@2x.png'),
        require('../../../assets/detail/menuIcon/position@2x.png'),
        require('../../../assets/detail/menuIcon/positionSelected@2x.png')
      ],
      menuIconActiveParams: {
        1: require('../../../assets/detail/menuIcon/trainSelected@2x.png'),
        41: require('../../../assets/detail/menuIcon/salSelected@2x.png'),
        74: require('../../../assets/detail/menuIcon/recruitSelected@2x.png'),
        34: require('../../../assets/detail/menuIcon/positionSelected@2x.png')
      },
      menuIconNormalParams: {
        1: require('../../../assets/detail/menuIcon/train@2x.png'),
        41: require('../../../assets/detail/menuIcon/sal@2x.png'),
        74: require('../../../assets/detail/menuIcon/recruit@2x.png'),
        34: require('../../../assets/detail/menuIcon/position@2x.png')
      }
    };
  },
  mounted() {
    let SecretKey =
        this.$route.query.SecretKey || localStorage.getItem('SecretKey');
    //河南测绘学院隐藏校招岗位
    if (SecretKey == '94cbe78f3bcec8be756042d1554c13b5') {
      this.menuList = [
        { title: '公司', value: '2' },
        { title: '职业', value: '3' },
        { title: '案例', value: '4' },
        { title: '视频', value: '5' },
        { title: '课件', value: '6' },
        { title: '简历模板', value: '7' }
      ];
      this.currentTab = 2;
      this.defaultActive = 2;
    }
  },
  methods: {
    handleSelect(values) {
      this.currentTab = values;
    }
  }
};
</script>

<style lang="scss" scoped>
.indexContentContainer {
  display: flex;
  margin-top: 14px;
  margin-right: 14px;
  width: 100%;
  .menu {
    width: 173px;
    margin-right: 14px;
    border-radius: 8px 8px 0 0;
    height: 100%;
    flex-shrink: 0;
    background-color: white;
    .menuTopTitle {
      padding: 11px 0 8px 20px;
      display: flex;
      align-items: center;
      width: 173px;
      height: 41px;
      background: #0b6eff;
      border-radius: 8px;
      .icon {
        width: 22px;
        height: 22px;
        margin-right: 8px;
      }
      .title {
        color: #fff;
        font-family: PingFang-SC, PingFang-SC;
        font-weight: bold;
        font-size: 16px;
      }
    }
  }
  .content {
    display: flex;
    min-width: 900px;
    flex: 1;
    background-color: white;
    border-radius: 10px 10px 0 0;
    border: 1px solid #cbdcfe;
  }
}
::v-deep .el-menu {
  width: 175px;
  border-right: 0px;
  background: #f5f5f5;
}
::v-deep .el-menu-item {
  padding-left: 60px !important;
  padding: 0;
  min-width: 145px;
  height: 41px;
  line-height: 41px;
  color: #999999;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 15px;
}
::v-deep .el-submenu__title {
  height: 41px;
  font-size: 16px;
  line-height: 41px;
  padding-left: 16px !important;
  color: #999999;
  background: #fff;
  // overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
::v-deep .el-menu-item.is-active {
  color: #0b6eff;
}
::v-deep .el-submenu.is-active > .el-submenu__title {
  color: #fff;
  padding-left: 9px !important;
  margin-left: 12px;
  background: #0b6eff;
  border-radius: 8px;
  &::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 41px;
    background: #0b6eff;
    position: absolute;
    left: -12px;
    border-radius: 8px;
  }
  .el-icon-arrow-down:before {
    color: #fff;
  }
}
.menuIcon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  margin-bottom: 3px;
  line-height: 16px;
}
</style>
